package com.cskaoyan.shopping.service.impl;

import com.cskaoyan.shopping.converter.ContentConverter;
import com.cskaoyan.shopping.dal.entitys.PanelContent;
import com.cskaoyan.shopping.dal.entitys.PanelContentItem;
import com.cskaoyan.shopping.dal.persistence.PanelContentMapper;
import com.cskaoyan.shopping.dto.PanelContentDto;
import com.cskaoyan.shopping.dto.PanelContentItemDto;
import com.cskaoyan.shopping.service.IContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * \* User: 余雨健
 * \* Date: 2022/10/25
 * \* Time: 21:06
 **/
@Service
public class IContentServiceImpl implements IContentService {

    @Autowired
    PanelContentMapper panelContentMapper;
    @Autowired
    ContentConverter contentConverter;

    /**
     *@
     *@author yuyujian
     *@Date 2022/10/26
     *@Time 17:40
     */
    @Override
    public List<PanelContentDto> queryNavList() {
        //获取panel_id为0的panel_content
        List<PanelContent> panelContents = panelContentMapper.selectPanelContentByPanelId(0);
        //转化
        List<PanelContentDto> panelContentDtos = contentConverter.panelContents2Dto(panelContents);
        return panelContentDtos;
    }

}
